<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>知识付费</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./static/css/font.css">
	<link rel="stylesheet" href="./static/css/weadmin.css">
    <script type="text/javascript"  src="./static/js/jquery.min.js" ></script>

    <script src="./lib/layui/layui.js" charset="utf-8"></script>

</head>
<body class="login-bg">
    
    <div class="login">
        <div class="message">知识付费</div>
        <div id="darkbannerwrap"></div>
        
        <form method="post" class="layui-form" id="loginForm">
            <input name="username" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <input class="loginin" id="logining" value="登录" lay-submit lay-filter="login" style="width:100%" type="button" onclick="submitFunction()">
            <hr class="hr20" >

        </form>
    </div>
    <script src="./static/js/republic.js" charset="utf-8"></script>
    <script type="text/javascript"  src="./static/js/admin.js" ></script>

    <script type="text/javascript">
        function  submitFunction() {
          var logining =   $('#logining')
            logining.val('登陆中..')
            logining.attr('onclick','')
            logining.attr('style','background: #aba9a9')
            $.ajax({
                type: "POST",
                url: serverUrl+'/login',
                xhrFields: {
                    withCredentials : true
                },
                header:{},
                data: $('#loginForm').serialize(),
                success: function (r) {
                    if (r.code == 0) {
                        document.location.href = "./index.html";
                        localStorage.setItem("jsessionid",r.data)
                        localStorage.setItem("token",r.data.token)
                    } else {
                        layer.msg(r.msg);
                        logining.attr('onclick','submitFunction()')
                        logining.attr('style','background: ')
                        logining.attr('style','background: ')
                        logining.val('登陆')
                    }
                },
            });
        }


    </script>  
    <!-- 底部结束 -->
</body>
</html>